<template>
  <router-view></router-view>
  <van-tabbar v-model="active" v-if="!route.meta.hidden" active-color="#ee0a24">
    <van-tabbar-item to="/" icon="home-o">
      首页
    </van-tabbar-item>
    <van-tabbar-item to="/item/cateList" icon="coupon-o">
      分类
    </van-tabbar-item>
    <van-tabbar-item to="/topic/index" icon="bag-o">
      值得买
    </van-tabbar-item>
    <van-tabbar-item to="/cart" icon="shopping-cart-o">
      购物车
    </van-tabbar-item>
    <van-tabbar-item to="/user" icon="user-o">
      个人
    </van-tabbar-item>
  </van-tabbar>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import request from '@/utils/request'
import { useRoute } from 'vue-router';
const active = ref(0);
const route = useRoute()

onMounted(async () => {
  try {
    let result = await request.get('/wyyx/xhr/index.json?__timestamp=1630131808529')
    console.log('我是首页推荐数据：', result);
    let res = await request.get('/app-dev/api/cart/cartList')
    console.log('我是商品详情数据：', res);

  } catch (error) {
    console.log('错误');
  }
})
</script>